package org.yang.database.minio.service;


import jakarta.validation.constraints.NotNull;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.yang.common.core.exception.BaseException;
import org.yang.database.minio.callback.Callback;

import java.util.Map;

/**
 * Minio常用接口
 * @author: Islands
 * @description:
 * @version：v1.0
 * @date: 2024/8/27 20:28
 */
@Validated
@Component
public interface MinioService {


    /**
     * 文件上传签名获取
     * @param bucketName 桶名称
     * @param fileName 文件名称
     * @param callback 回调函数(实现Callback<T>.run(PostPolicy policy)接口)
     * @return Map<String, String>
     * @throws BaseException 异常
     */
    Map<String, String> signature(@NotNull String bucketName,@NotNull String fileName, Callback callback) throws BaseException;
}
